package com.zt.yongxinbao.entity;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;

@Document(indexName = "yxb", type = "product1",shards = 1,replicas = 0)
public class EsProduct {
    @Id
    private Long id;
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String title;
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String company;
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String introduction;
    @Field(type = FieldType.Keyword)
    private String deadline;
    @Field(type = FieldType.Keyword)
    private Integer addtime;
    @Field(type = FieldType.Keyword)
    private Integer valid;
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String username;
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String tag;
    @Field(type = FieldType.Keyword)
    private BigDecimal value;
    @Field(type = FieldType.Keyword)
    private String img;
    @Field(type = FieldType.Keyword)
    private BigDecimal score;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company == null ? null : company.trim();
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction == null ? null : introduction.trim();
    }

    public String getDeadline() {
        return deadline;
    }

    public void setDeadline(String deadline) {
        this.deadline = deadline == null ? null : deadline.trim();
    }

    public Integer getAddtime() {
        return addtime;
    }

    public void setAddtime(Integer addtime) {
        this.addtime = addtime;
    }

    public Integer getValid() {
        return valid;
    }

    public void setValid(Integer valid) {
        this.valid = valid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag == null ? null : tag.trim();
    }

    public BigDecimal getValue() {
        return value;
    }

    public void setValue(BigDecimal value) {
        this.value = value;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img == null ? null : img.trim();
    }

    public BigDecimal getScore() {
        return score;
    }

    public void setScore(BigDecimal score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "EsProduct{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", company='" + company + '\'' +
                ", introduction='" + introduction + '\'' +
                ", deadline='" + deadline + '\'' +
                ", addtime=" + addtime +
                ", valid=" + valid +
                ", username='" + username + '\'' +
                ", tag='" + tag + '\'' +
                ", value=" + value +
                ", img='" + img + '\'' +
                ", score=" + score +
                '}';
    }
}